package com.jyw.business.obstacles.domain.vo.web;

import com.jyw.business.obstacles.constant.TalkTypeConstant;
import com.jyw.business.obstacles.domain.dto.web.VAAEventDto;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;

/**
 * @author 沈峻
 * @ClassName VAARedisDto
 * @Date 2023/7/11 14:45
 **/
@Data
public class VAARedisVO {
    /**
     * 唯一标识
     */
    private String callId;

    /**
     * 呼入电话
     */
    private String caller;

    /**
     * 线路名称
     */
    private String portName;

    /**
     * 来电时间
     */
    private LocalDateTime date;

    /**
     * 通话类型
     * 已接	0
     * 呼出	1
     * 未接	2
     * 回拨	3
     */
    private Integer type;

    /**
     * 是否发送弹窗
     */
    private Integer sendPopUp;

    /**
     * 录音文件名
     */
    private String FilePath;

    /**
     * 构建盒子发送呼入时间
     * @param vo
     * @return
     */
    public static VAARedisVO buildCallIn(VAAEventDto vo){
        VAARedisVO redis = new VAARedisVO();
        BeanUtils.copyProperties(vo,redis);
        redis.setType(TalkTypeConstant.MISSED_CALL);
        redis.setSendPopUp(0);
        return redis;
    }

    /**
     * 构建盒子发送呼入时间
     * @param vo
     * @return
     */
    public static VAARedisVO buildCallOut(VAAEventDto vo){
        VAARedisVO redis = new VAARedisVO();
        BeanUtils.copyProperties(vo,redis);
        redis.setType(TalkTypeConstant.CALL_OUT);
        redis.setSendPopUp(0);
        return redis;
    }


}
